import Shell from 'gi://Shell';
import * as Main from '../ui/main.js';
+import * as SignalTracker from '../misc/signalTracker.js';
const SCALE_VALUE_N_STEPS = 20;
const SCALE_VALUE_CHANGE_EPSILON = 0.001;
.some(m => m.get_backlight() && m.is_active());
});
+ this._monitorScales.values().forEach(scale => scale.destroy());
this._monitorScales.clear();
for (const monitor of monitors) {
GObject.ParamFlags.READWRITE,
0, 1.0, 1.0),
},
+ Signals: {
+ 'destroy': {},
+ },
}, class BrightnessScale extends GObject.Object {
constructor(name, value = 1.0, nSteps = SCALE_VALUE_N_STEPS) {
super();
this._value = Math.clamp(value, 0.0, 1.0);
this.notify('value');
}
+
+ destroy() {
+ this.emit('destroy');
+ }
});
+SignalTracker.registerDestroyableType(BrightnessScale);
const MonitorBrightnessScale = GObject.registerClass({
Signals: {